<?php

namespace App\Models;

use Dcat\Admin\Traits\HasDateTimeFormatter;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Str;
use Laravel\Scout\Searchable;

class AdminMenuSearch extends Model
{
	use HasDateTimeFormatter;
    use Searchable;

    protected $table = 'admin_menu_search';
    public $timestamps = false;

    public function searchableAs()
    {
        return str_replace('.', '_', str_replace(['https://', 'http://'], '', env('APP_URL', 'minisns.cn'))).'_'.'admin_menu_search_index';
    }
    /**
     * 获取模型的可索引的数据。
     *
     * @return array
     */
    public function toSearchableArray()
    {
        $array = $this->toArray();
        $search_data = [
            'id' => $array['id'],
            'lower' => $array['lower'],
        ];

        return $search_data;
    }

}
